<?php

/** Yz_Int:

*/

class Yz_Int extends Yz_Class
{

    /** valueOf(): reduce the value to string
    *       Objects which have toString() do not count
    *   @param scalar value
    *   @return string|null
    */
    public static function valueOf( $value )
    {
        $pValue = null;
        // NOTE: is scalar test required to avoid warnings in is_numeric?
        // if (is_scalar($value) && is_numeric($value)) // "null" is not considered scalar
        if (is_numeric($value)) // "null" is not considered scalar
            $pValue = (int)$value;
        return $pValue;
    } // valueOf

} // class

